package com.maoyu.cloud.user.service;

import com.maoyu.cloud.exception.EmailExitException;
import com.maoyu.cloud.exception.MobileExitException;
import com.maoyu.cloud.exception.UserNameExitException;
import com.maoyu.cloud.mybatis.entity.PtUserEntity;
import com.maoyu.cloud.mybatis.entity.ZtreeEntity;
import com.maoyu.cloud.mybatis.flexigrid.PadingRstType;
import com.maoyu.cloud.mybatis.flexigrid.PagingBean;
import com.maoyu.cloud.user.entity.SearchUserEntity;
import com.maoyu.cloud.user.entity.UserEntity;
import com.maoyu.cloud.user.exception.PasswordError;
import org.apache.ibatis.annotations.Param;
import sun.security.util.Password;

import java.util.List;

public interface UserService {
    List<PtUserEntity> queryUserListByName(SearchUserEntity search);

    void modifyPassword(String oldPassword, String newPassword) throws PasswordError;
    PadingRstType<PtUserEntity> getUserInfolistByPage(SearchUserEntity search, PagingBean paging);

    void addUser(UserEntity userEntity) throws UserNameExitException, EmailExitException, MobileExitException;

    UserEntity queryUserInfoById(String userUuid);

    void updateUserInfo(UserEntity userEntity) throws UserNameExitException, EmailExitException, MobileExitException;

    void deleteUserInfoByIds(String userUuids);

    List<ZtreeEntity> queryRoleZtreeByUserId(String userUuid);

    void saveRoleRelUser(String userUuidArray, String roleArray);

    List<ZtreeEntity> queryRoleZtreeAll();

    /**
     * 重置密码
     * @param userUuidArray
     * @param password
     */
    void resetPassword(String userUuidArray, String password);

    void save(@Param("entity") PtUserEntity entity);
}
